import React, { PureComponent } from 'react';
import {
  Card, Button
} from 'antd';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import { connect } from 'dva';

@connect(({ cache, loading }) => ({
  cache,
  loading: loading.models.cache,
}))
class Cache extends PureComponent {

  clearCache = () => {
    console.log('清除缓存')
    const { dispatch } = this.props;
    dispatch({
      type: 'cache/clearAll'
    })
  }

  render() {
    return (
      <PageHeaderWrapper title="接口文档">
        <Card bordered={false}>
          <Button onClick={() => this.clearCache()}>清除缓存</Button>
        </Card>
      </PageHeaderWrapper>
    )
  }
}

export default Cache;